package com.wlcj.www.model.data;

import com.jfinal.plugin.activerecord.Model;
import com.wlcj.util.CacheKeyUtil;
import com.wlcj.util.RedisUtil;

public class Province extends Model<Province> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8811878322419465197L;
	
	public static final Province dao = new Province();
	
	public Province getCacheProvinceById(int id) {
		String key = CacheKeyUtil.getProvinceKey(id);
		Province p = RedisUtil.get(key);
		if(p==null) {
			p = findById(id);
			RedisUtil.set(key, p);
		}
		return p;
	}
	

}
